package com.laotou99.backjack.test;

import static org.junit.Assert.*;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.Arrays;

import org.junit.Before;
import org.junit.Test;

public class MainTest7 {

	@Before
	public void setUp() throws Exception {
	}

	@Test
	public void test() {
//		fail("Not yet implemented");
		test1();
	}
	
	public void test1(){
		
		System.out.println("Test1");
		String str1 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
				+ "adfasdfasdfasssssssssssssssssssssssssssssss"
				+ "fdafasdfasdfasd"
				+ "ffadfasdfdsfffffffffffffffffffeeeeeeeeeeeeeeeee"
				+ "aaaaaaaaaaaaawwwwwwwwwwwwwwwwwwwwwwwwbbbbbbbbbbbbbb"
				+ "dfewereqfbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
		
		byte[] bb1 = str1.getBytes();
		System.out.println(Arrays.toString(bb1));
		ByteArrayInputStream bais = new ByteArrayInputStream(bb1);
		System.out.println(bais.toString()); 
		
		try {
			byte[] bb2 = new byte[bais.available()];
			bais.read(bb2); 
			bais.close();
			System.out.println(Arrays.toString(bb2));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

}
